home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gekikoh Dennoh Club 1
/
Gekikoh Dennoh Club Vol. 1 (Japan).7z
/
Gekikoh Dennoh Club Vol. 1 (Japan) (Track 1).bin
/
kowin
/
archive
/
sys
/
koadd.lzh
/
patch
/
_start.c
< prev
Wrap
C/C++ Source or Header
|
1994-11-30
|
926b
|
54 lines
#include <sys_doslib.h>
extern void *_PSP,
*_PSTA,
*_DSTA,
*_BSTA;
*_SSTA;
*_HSTA;
*_HEND;
extern int argc;
extern char **_argv;
void
_start( pp )
struct PDBADR *pp;
{
int ac;
_PSP= pp;
_PSTA= (char*)(pp+256-16);
_DSTA= pp->heap;
_BSTA= pp->bss;
{
int i;
char **av,
*s= pp->stack,
*p= pp->cmdline+1;
for( ac= 0 ; *p ; ac++ ){
for(; *p && *p <= ' ' ; p++ );
for(; *p > ' ' ; *s++= *p++ );
*s= '\0';
}
_argv= av= (void*)((int)s+3)&0xfffffffc;
*av++= pp->exe_name;
for( p= pp->stack, i= 0 ; i< ac ; i++ ){
for( *av++= p ; *p++ ;);
}
*av++= 0;
_argc= ac+1;
_HSTA= _HEND=
(_SSTA= (void*)((int)av+3)&0xfffffffc) + STACKSIZE;
}
asm volatile ("move.l %0,sp" : /* no outputs */ : "g" (_hsta));
if( SETBLOCK( pp, (int)_HEND - (int)pp ) < 0 )
EXIT2( 0 );
_vectormove ();
exit (main (_argc, _argv, _envp));
}